package what.the.fun.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

import what.the.fun.domain.Question;

public class QuestionExtractor implements ResultSetExtractor<Question>{

	@Override
	public Question extractData(ResultSet arg0) throws SQLException,
			DataAccessException {
		Question data = new Question();
		data.setQuestId(arg0.getString(1));
		data.setQuestContent(arg0.getString(2));
		data.setSurveyId(arg0.getString(3));
		data.setLimitAnswer(arg0.getInt(4));
		
		return data;
	}

}
